<?php


/**
* Puree CMS
* http://www.molotsoft.ru
*
* @package Puree_CMS
* @subpackage Models
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: project.php 1063 2010-03-23 20:50:43Z molotsoft@gmail.com $
* @link $HeadURL: http://puree-cms.googlecode.com/svn/trunk/models/project.php $
*/


class Project extends GeneralModel {

/******************************************************************************/

var $name = 'Project';

var $belongsTo = array(
	'Customer'
);

var $hasAndBelongsToMany = array(
	'Activity',
	'News',
	'Event',
	'Article'
);

var $hasMany = array(
	// attachments
	'AttachmentImage' => array('dependent' => TRUE, 'foreignKey' => 'foreign_key', 'conditions' => array('model' => 'Project')),
	'AttachmentVideoFile' => array('dependent' => TRUE, 'foreignKey' => 'foreign_key', 'conditions' => array('model' => 'Project'))
);

var $displayImage = 'thumbnail';
var $displayField = 'caption';

var $order = array(
	'Project.published' => 'DESC',
	'Project.id' => 'DESC'
);

var $actsAs = array(
	'Admin.Automate',
	'Containable'
);

var $fieldInputSchema = array(
	'image' => array('params' => 'resize=max&x=1000&y=750'),
	'thumbnail' => array('params' => 'source=image&resize=crop&x=160&y=160')
);

/******************************************************************************/

}


?>